package com.wosiliujing.learning.service;

import com.wosiliujing.learning.admin.dto.UserInfo;
import com.wosiliujing.learning.constant.MicroServiceNameConstants;
import com.wosiliujing.learning.constant.SecurityConstants;
import com.wosiliujing.learning.fallback.RemoteSysUserFallbackImpl;
import com.wosiliujing.learning.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author liujing
 */
@FeignClient(value = MicroServiceNameConstants.LEARNING_ADMIN, fallback = RemoteSysUserFallbackImpl.class,contextId ="remoteSysUserService" )
public interface RemoteSysUserService {

    /**
     * 通过用户名获取用户信息
     * @param userName
     * @return
     */
    @RequestMapping("/user/info/{userName}")
    R<UserInfo> info(@PathVariable("userName") String userName, @RequestHeader(SecurityConstants.FROM) String from);

}
